package com.im.web.controller;

import com.im.web.core.controller.BaseController;
import com.im.web.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author gongym
 * @date 2019/1/16 11:31
 */
@RestController
@RequestMapping(value = "/api/im/user/", produces = "text/plain;charset=UTF-8")
public class UserController extends BaseController {
  private final UserService userService;

  @Autowired
  public UserController(UserService userService) {
    this.userService = userService;
  }

  @RequestMapping(value = "info", method = RequestMethod.POST)
  public String userInfo() {
    return userService.userInfo();
  }

  @RequestMapping(value = "userInfo", method = RequestMethod.GET)
  public String userInfo(Long userId) {
    return userService.userInfo(userId);
  }

  @RequestMapping("getUserChat")
  public String getUserChat(Long userId) {
    return userService.getUserChat(userId);
  }

  @RequestMapping("getUserRelation")
  public String getUserRelation(Long userId) {
    return userService.getUserRelation(userId);
  }

  @RequestMapping("getUserRelationInfo")
  public String getUserRelationInfo(Long userId) {
    return userService.getUserRelationInfo(userId);
  }
}
